'''
class Dog:
    def __init__(self,name,age):
        self.name = name
        self.age = age
    
    def sit(self):
        print(f"{self.name} is now sitting.")
    
    def roll_over(self):
        print(f"{self.name} rolled over!")

my_dog = Dog('Willie',6)
print(f"My dog's name is {my_dog.name}")
print(f"My dog is {my_dog.age} years old.")
'''

#练习9-1

class Restaurant:
    def __init__(self,name,type):
        self.name = name
        self.type = type
    
    def describe_restaurant(self):
        msg = f"{self.name}提供{self.type}"
        print(msg)
    
    def open_restaurant(self):
        print(f"{self.name}餐厅正常营业！")

mango = Restaurant('白龙山食堂','中式快餐')
mango.describe_restaurant()
mango.open_restaurant()
Restaurant('白龙山食堂','中式快餐').describe_restaurant()


#练习9-3
'''

class User:
    def __init__(self,first_name,last_name,email):
        self.first_name = first_name
        self.last_name = last_name
        self.email = email

    def describe_user(self):
        print(f"{self.first_name} {self.last_name}'s email is {self.email}")

    def greet_user(self):
        print(f"welecom to our web {self.first_name} {self.last_name}")

wjy = User('王','靖圆','wjy@e.com')
wjy.describe_user()
wjy.greet_user()

wjw = User('吴','家文','wjw@e.com')
wjw.describe_user()
wjw.greet_user()
'''
